<?php

namespace app\common\controller;

use app\common\token\Token;
use app\common\event\VerifyToken;
use think\App;

/**
 * Token校验控制器
 * Class TokenController
 * @package app\common\controller
 */
class TokenController extends BaseController
{
    /**
     * @var array 设置Ture控制器方法全局跳过权限验证,可以是数组或者字符串
     */
    protected $no_token = [];

    public function __construct(App $app = null)
    {
        parent::__construct($app);

        //检测控制器需不需要token
        if (!empty($this->no_token) && checkMixedExist($this->no_token, $this->request->action())) {
            return;
        }
        //touken验证
        $res = event(VerifyToken::class);
    }

}
